1. Field of the Invention
The invention is generally related to systems and methods for transferring data to memory. In particular, the present invention is related to systems and methods for transferring a multidimensional array of data to a non-contiguous buffer.
2. Background
Very often in computer systems it is necessary to transfer large multidimensional arrays of data, such as two-dimensional (2-D) arrays of raw video data, from a source device to a destination memory system. Certain conventional source devices will not transfer the source data to the destination memory system unless a requisite amount of contiguous memory space is available at the destination. For example, the ATI Theater™ 550 Pro (a product of ATI Technologies Inc. of Markham, Ontario) requires that a driver allocate a contiguous buffer in the destination memory space that is large enough to hold the contents of the entire source buffer. The driver must then copy the data into the sparse memory area for an application to use. This approach is rather inefficient as the data transfer is delayed if there is not a large enough contiguous block of destination memory space currently available to store the array.
The Rockwell Bt878/879 (a product of Rockwell Semiconductor Systems of Newport Beach, Calif.) transfers video data over a PCI bus to a personal computer (PC) system. The Rockwell Bt878/879 does not require a complete contiguous destination buffer, but it does require that each line of video data be transferred to a linear, contiguous, area of memory. This essentially changes the problem to transferring data into a series of one-dimensional buffers. For long, high-definition scan lines, this may require larger contiguous blocks of memory than are currently available.
In some systems, the receiving system provides a table that identifies a series of blocks of available memory which may be scattered throughout the destination memory space. The source devices mentioned above cannot use any of these blocks of available memory unless they each exceed a predetermined amount of contiguous memory. In the case of the ATI Theater™ 550 Pro, a block must be large enough to hold the entire source buffer, whereas in the case of the Rockwell Bt878/879, a block must be large enough to hold at least one line of video data.
What is desired then is a system and method for transferring a multidimensional array of data, such as a 2-D array of video data, from a source device to a destination memory system that addresses the foregoing shortcomings of conventional solutions. In particular, the desired system and method should be able to map the elements of a large multidimensional array of data from a source device into blocks of contiguous memory available in a destination memory system, even when the destination blocks are small and/or their size does not correlate in any way to the dimensions of the source buffer. Additionally, the desired system and method should be able to gracefully handle situations where an arbitrary number of samples in the stream of data being transferred from the source device to the destination memory system are skipped. Such “jumps” in the data stream may occur if there is an overflow of the source buffer as a result of latency in a system where the data transfer takes place over a variable speed interface.